package com.zpark.cloud.alibaba.mapper;

import com.zpark.cloud.alibaba.entity.Storage;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/**
 * 库存持久层接口
 */
public interface IStorageMapper extends Mapper<Storage> {

    // 根据商品id查询库存信息
    @Select("SELECT id, product_id, total, used, residue FROM t_storage WHERE product_id=#{pId}")
    Storage selectByProductId(Long pId);
}
